﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _16_List集合集合lambda表达式与泛型委托
{
    public class Student
    {
        private int _id;
        private string _name;
        private string _subject;
        private int _score;

        //定义公有属性: 学号、姓名、考试科目、考试成绩
        public int Id { get => _id; set => _id = value; }
        public string Name { get => _name; set => _name = value; }
        public string Subject { get => _subject; set => _subject = value; }
        public int Score { get => _score; set => _score = value; }

        public Student(int id, string name, string subject, int score)
        {
            Id = id;
            Name = name;
            Subject = subject;
            Score = score;
        }

        public void PrintInfo()
        {
            Console.WriteLine("学号:{0},姓名:{1},科目:{2},成绩:{3}", Id, Name, Subject, Score);
        }
        
    }
}
